package com.lemon.smartsafety.ui.activity.common;

import android.content.Context;
import android.os.Bundle;

import com.lemon.smartsafety.app.BundleKey;
import com.lemon.smartsafety.entity.event.common.PanelEvent;
import com.lemon.smartsafety.entity.safe.company.CompanyInfo;
import com.lemon.smartsafety.ui.activity.safe.data.CompanyBasicInfoActivity;
import com.lemon.smartsafety.ui.activity.safe.data.contract.KeepContractListActivity;
import com.lemon.smartsafety.ui.activity.safe.data.safe_manager.SafeManagerListActivity;
import com.lemon.smartsafety.ui.activity.safe.data.wuye.WuyeRecordListActivity;
import com.lemon.smartsafety.ui.activity.safe.inspection.SafeInspectionBuildingListActivity;
import com.lemon.smartsafety.ui.adapter.safe.data.ItemTag;
import com.lemon.smartsafety.utils.app.HUDUtil;
import com.lemon.smartsafety.utils.app.UIHelper;

/**
 * Created by Cooliean on 16/4/1.
 */
public class PanelEventHandler {
    public static void panelEventHandle(PanelEvent<ItemTag> event, Context context, CompanyInfo mCompanyInfo, HUDUtil mHUDUtil) {
        if (ItemTag.TAG_SAFE_INSPECTION == event.getDataI().getTagI()) {//安全巡查
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showActivity(context, bundle, SafeInspectionBuildingListActivity.class);
        } else if (ItemTag.TAG_BASIC_ITEM == event.getDataI().getTagI()) {//单位基本信息
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showActivity(context, bundle, CompanyBasicInfoActivity.class);
        } else if (ItemTag.TAG_BUILDING_RECORD == event.getDataI().getTagI()) {//建筑场所登记
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showSafeDataCollectionBuildingList(context, bundle);
        } else if (ItemTag.TAG_CHECK_ITEM_MANAGER == event.getDataI().getTagI()) {//检查项目管理
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showSafeDataCollectionCheckItemBuildingList(context, bundle);
        } else if (ItemTag.TAG_WEI_BAO_RECORD == event.getDataI().getTagI()) {//维保单位登记
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showActivity(context, bundle, KeepContractListActivity.class);
        } else if (ItemTag.TAG_WU_YE_RECORD == event.getDataI().getTagI()) {//物业单位登记
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showActivity(context, bundle, WuyeRecordListActivity.class);
        } else if (ItemTag.TAG_SAFE_MANAGER_SETTING == event.getDataI().getTagI()) {//安全管理设置
            Bundle bundle = new Bundle();
            bundle.putSerializable(BundleKey.COMPANY_INFO, mCompanyInfo);
            UIHelper.showActivity(context, bundle, SafeManagerListActivity.class);
        } else if (ItemTag.TAG_WORKER_REPAIR == event.getDataI().getTagI()) {//我的报修
            mHUDUtil.showDeveloper();
        } else if (ItemTag.TAG_WORKER_ZXZZ == event.getDataI().getTagI()) {//专项整治上报
            mHUDUtil.showDeveloper();
        }
    }
}
